<?php

/*

  Action	$5

  Reveal the top 4 cards of your deck, then discard them. +$1 per differently named card revealed.

 */

class Harvest extends Card implements iAction, iKingdom, iCornucopia {

    public function __construct() {
        parent::__construct("Harvest", 5);
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    public function getDescription() {
        return array(
            "Reveal the top 4 cards of your deck, then discard them. +$1 per differently named card revealed.");
    }
    
    public function play(Game $game, $isRealCard) {

        $cards = $game->removeCardsFromDrawDeck(4);
        $unique = getUniqueCards($cards);
        $game->discardTempDiscardCards($cards);
        
        $coins =sizeof($unique);
         ScreenDisplay::addScreenMessage($game, true, "discard " . nicePrint($cards). " and get +$coins$", "discard " . ScreenDisplay::$LMSG. " cards and get +$coins$");
        $game->addMoney(new Price($coins));
		$game->cardActionFinished();
        return true;
    }

}

?>